<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" type="text/css" href="/libs/bootstrap/css/bootstrap.min.css">
    <link href="http://pinzafile.oss-cn-shanghai.aliyuncs.com/publiccss/assets/global/plugins/layui/css/layui.css" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" type="text/css"
          href="http://pinzafile.oss-cn-shanghai.aliyuncs.com/admin/product/libs/font-awesome/css/font-awesome.min.css">
    <link rel=stylesheet href="/css/style.css" type="text/css">
    <link href="/css/style-shop.css" rel="stylesheet" type="text/css">


</head>
<div class="page-header">
    <div class="page-header-top">
        <div class="container">
            <!-- LOGO -->
            <div class="page-logo">
                <a href="index.html">
                    <img src="image/logo.png" alt="logo" class="pinza-logo">
                </a>
            </div>
            <!--菜单-->
            <div class="top-menu">
                <ul class="nav pull-right">
                    <!--个人中心-->
                    <li class="dropdown dropdown-extended dropdown-dark dropdown-inbox" id="header_inbox_bar">
                        <a href="http://pinzabim.oss-cn-shanghai.aliyuncs.com/Optional/home.html" target="_blank">选装体验</a>
                    </li>
                    <!-- 个人中心 -->
                    <!--<li class="dropdown dropdown-user dropdown-dark">-->
                    <!--<a href="login_2nd.html">-->
                    <!--<span class="username username-hide-mobile">登录</span>-->
                    <!--</a>-->
                    <!--</li>-->
                    <li class="dropdown dropdown-user dropdown-dark">
                        <a href="/index.page" target="_blank">
                            <span class="username username-hide-mobile">客户中心</span>
                        </a>
                    </li>
                    <li class="dropdown dropdown-user dropdown-dark">
                        <a href="shopcar.html">
                            <span class="username username-hide-mobile">购物车</span>
                        </a>
                    </li>
                </ul>
            </div>

            <div class="clearfix"></div>
        </div>
    </div>

</div>
<div class="container">
    <div class="row">
        <ul class="breadcrumb">
            <li><a href="index.html">首页</a></li>
            <li class="active">选装列表</li>
        </ul>
    </div>
</div>

<div class="container" style="background: white">

    <div class="layui-card">
        <div class="layui-card-header">填写订单信息</div>
        <div class="layui-card-body" style="padding: 15px;">
            <form id="addressform" class="layui-form"  lay-filter="component-form-group">
                <div class="layui-form-item">
                    <label class="layui-form-label">订单总额</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">订单名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="order_name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <#--<div class="layui-form-item">-->
                    <#--<div class="layui-inline">-->
                        <#--<label class="layui-form-label">采购员</label>-->
                        <#--<div class="layui-input-block">-->
                            <#--<input  type="text"  name="buyer"  lay-verify="required|phone" autocomplete="off" class="layui-input">-->
                        <#--</div>-->
                    <#--</div>-->
                <#--</div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">项目名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="project_name" lay-verify="identity" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收货人</label>
                    <div class="layui-input-block">
                        <input type="text" name="consignee_name" lay-verify="identity" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系方式</label>
                    <div class="layui-input-block">
                        <input type="text" name="consignee_phone" lay-verify="identity" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">地址</label>
                    <div class="layui-input-block">
                        <input type="text" name="consignee_address" lay-verify="identity" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="row back">
        <div class="container place-order-detail">
            <div class="addValue-checked"></div>
            <div class="row addValue-prices">
                    <button class="btn btn-primary bt-print-submit" id="submit" type="button">提交订单</button>
            </div>
        </div>
    </div>

</div>



</body>
</html>
<script type=text/javascript src="/js/jquery-2.0.3.min.js"></script>

<script src="http://pinzafile.oss-cn-shanghai.aliyuncs.com/publiccss/assets/global/plugins/layui/layui.js"  type="text/javascript"></script>

<!--滚动条脚本-->
<script src="/js/jquery.nicescroll.js"></script>

<script>
    $("body").niceScroll({
        cursorcolor: "#ccc",//#CC0071 光标颜色
        cursoropacitymax: 1, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
        touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
        cursorwidth: "5px", //像素光标的宽度
        cursorborder: "0", // 游标边框css定义
        cursorborderradius: "5px",//以像素为光标边界半径
        autohidemode: true //是否隐藏滚动条
    });

    layui.use(['layer'], function(){
        $("#submit").click(function (){
            // var boolinput = true;
            // var boolselect = true;
            // for(var i = 0;i<$("input[required=\"required\"]").length;i++){
            //     if($("input[required=\"required\"]")[i].value == ""){
            //         boolinput = false;
            //         break;
            //     }
            // }
            // for(var i = 0;i<$("select[required=\"required\"]").length;i++){
            //     if($("select[required=\"required\"]")[i].value == ""){
            //         boolselect = false;
            //         break;
            //     }
            // }
            // if(boolinput && boolselect){
                var formData = new FormData($("#addressform")[0]);
            //     layer.load();
                $.ajax({
                    url: '/order/save.json',
                    type: 'post',
                    data: formData,
                    dataType: 'json',
                    async: true,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (result) {
                        if(result.ret){
                            layer.closeAll('loading');
                            //询问框
                            layer.confirm('添加成功是否前往订单列表页？', {
                                btn: ['是','否'] //按钮
                            }, function(){
                                window.location.href="/contract/list.page";
                            }, function(){
                                layer.alert("您已取消前往",{icon: 2})
                            });
                            // window.location.reload();
                        }else{
                            layer.closeAll('loading');
                            layer.alert(result.msg,{icon: 2})
                        }
                    }
                });
            // }else{
            //     layer.alert('主人，您有必选项没有填写，无法提交表单', {icon: 6});
            // }
            // $("input[required=\"required\"]")
        });
    });
</script>


<script src="/js/active.js" type="text/javascript"></script>
<script type=text/javascript src="/js/jquery-2.0.3.min.js"></script>
